Part Number Hot Search : 
0150CT SMA6863M LB11872V MC540 10N65KL HC240 SF007 MGB38TA
Product Description
Full Text Search
 

To Download BUZZ1 Datasheet File

  If you can't view the Datasheet, Please click here to try to view without PDF Reader .  
 
 


  Datasheet File OCR Text:
 Application Notes
M16C/26A Group
Sample Program (Musical Scale)
1. Summary
This sample program provides the functionality of musical scale output by using the Renesas Starter Kit for M16C/26A (R0K33026AS000BE) and an extension board.
Turning the potentiometer changes the sound and frequency.
The extension board used here is a product from PI System Co., Ltd.
2.
Introduction
Microcomputers: M16C26A
The example described in this document applies to the microcomputers listed below:
This sample program runs on the Renesas Starter Kit for M16C/26A (R0K33026AS000BE). Prepare an extension board available for the Renesas Starter Kit or create a circuit similar to the one shown in the example circuit on page 14 and then connect it to the Starter Kit. This program uses RSK_LIB. For details about RSK_LIB, see the RSK_LIB reference manual. (RSK_LIB is the library software provided for use with the Renesas Starter Kit for M16C/26A.)
REJ05B0817-0110 Rev.1.10
2007.12
Page 1 of 17
M16C/26A Group Sample Program (Musical Scale) 3. Port Arrangement
The buzzer shown here is the facility mounted on an extension board for the Renesas Starter Kit. To use this facility, connect an extension board to the Starter Kit. LCD VR P93 P91 P90 P63 P62 P61 10MHz Xin P60 LCD E LCD_RS LCD D7 LCD D6 LCD D5 LCD D4
sca
l
e d o
259Hz
SW1
P83
P72
M30260F8AGP
BUZZER
REJ05B0817-0110 Rev.1.10
2007.12
Page 2 of 17
M16C/26A Group Sample Program (Musical Scale)
4.
Operational Outline
The variable resistor (R9) mounted on the board is used to adjust the musical scale and sound a buzzer. Scales and frequencies are displayed as adjusted with the variable resistor (R9). Turning the variable resistor (R9) clockwise lowers the sound, and turning it counterclockwise raises the sound. When SW1 is pressed while a scale is sounded, the sound stops and a string "mute" is displayed on liquid crystal display.
Liquid crystal display Scale Hz Do
Liquid crystal display Scale Hz Re
Liquid crystal display Scale Hz Do
M16C26A
M16C26A
M16C26A
Buzzer
R9 SW3 SW2 SW1/ BOOT
Buzzer
Buzzer
R9 SW3 SW2 SW1/ BOOT R9 SW3 SW2 SW1/ BOOT
Outputs the sound do
Outputs the sound re
Outputs the sound do
The operation described above is accomplished using the following microcomputer facilities: * Timer A0 (timer mode, main 2 ms cycle) This timer counts 2 milliseconds using the main clock of the microcomputer as the count source. It is used as the basic timer of RSK_LIB. Time management, LCD display management and AD input are performed using this timer. * AD24 (single-shot mode, AD value measurement) Analog voltages are converted to digital data using the main clock of the microcomputer as a conversion clock. More specifically, the analog voltages output from the variable resistor (R9) are A/D converted. * Timer A1 (pulse modulation mode, buzzer output) This timer outputs a waveform with different high and low pulse widths using the main clock of the microcomputer as the count source. The high-level width of the output pulse is changed to alter the frequency, by which the buzzer tone is varied.
REJ05B0817-0110 Rev.1.10
2007.12
Page 3 of 17
M16C/26A Group Sample Program (Musical Scale)
5.
Operational Specification
(1) Immediately after the reset switch is depressed, the scale corresponding to a variable resistor position is output. (2) Scale output and display are changed using the variable resistor (R9). (3) Scale output is turned on or off by pressing SW1. When scale output is turned off, a string "mute" is displayed. (1) Reset switch depressed
s
cal
e
(2) Variable resistor
259Hz
do
Relationship between VR Input (Input Voltage) and Scale Output
Input voltage
Frequency do re mi fa so la si do
s
cal
e re
(3) SW1 depressed
0 -0.625V 0.625 -1.25V 1.25 -1.875V 1.875 - 2.5V 2.5 - 3.125V 3.125 - 3.75V 3.75 - 4.375V 4.375 - 5V
259Hz 292Hz 327Hz 347Hz 393Hz 441Hz 498Hz 524Hz
292Hz
s
cal
e mu t e
(4) SW1 depressed
* The AD values are set by calling the common function "AD average" (RL_AdVeraging). Within the function, a value is sampled 6 times, and the sampled values except the maximum and minimum values are averaged, the result of which is returned. This average value is acquired 8 times, the average of which is made a fixed value.
s
cal
e re
292Hz
REJ05B0817-0110 Rev.1.10
2007.12
Page 4 of 17
M16C/26A Group Sample Program (Musical Scale) 6. Definition of the RSK Functionality and the RSK_LIB APIs and Common Functions Used by Musical Scale
6.1 Definition of the RSK Functionality
RSKdefine.h file In this application, the following functionalities (those shown in red) are set /********************************************************* The boot information on CPU is defined Usually, this mode is used *********************************************************/ #define _CPU_M16C26A_NORMAL_MOD /* Use in low power mode can be performed. */ //#define _CPU_M16C26A_32KHZ_MOD /* Use of access of a flash can be performed. */ //#define _CPU_M16C26A_DATAFLASF_USE /******************************************************** The hardware function which RSK supports is chosen /********************************************************/ //#define _USE_KEY #define _USE_BUZZER #define _OPTION_USE_AD //#define _OPTION_USE_COM_RX //#define _OPTION_USE_COM_TX //#define _OPTION_USE_INFRAEDRX //#define _OPTION_USE_INFRAEDTX #define _OPTION_USE_SW //#define _OPTION_USE_LED //#define _OPTION_USE_IO
Individual definition of each selected functionality #if defined _OPTION_USE_AD /* Define Illumimeter Adc */ //#define _OPTION_USE_AD0 /* Define Vr Adc */ //#define _OPTION_USE_AD24 #endif #if defined _OPTION_USE_SW #define _OPTION_USE_PUSHSW1 //#define _OPTION_USE_PUSHSW2 //#define _OPTION_USE_PUSHSW3 #endif
Potentiometer input AD is used
Pushbutton SW1 is used
REJ05B0817-0110 Rev.1.10
2007.12
Page 5 of 17
M16C/26A Group Sample Program (Musical Scale)
6.2 APIs and Common Functions Used
ApiStatusType RL_SetTimerReq( unsigned int TimerValue, char TimerMode, int *TimerNo, int *ERcode ); ApiStatusType RL_StartTimer( int TimerNo, int *ERcode ); ApiStatusType RL_CheckTimer( int TimerNo, int *ERcode ); ApiStatusType RL_Putc_Lcd( char Ylocation, char outc, int *ERcode ); ApiStatusType RL_Puts_LcdLoc( char Xlocation, char Ylocation, char RvTime, const char far* outc, int *ERcode ); ApiStatusType RL_Start_Buzzer( char freqNo, int *ERcode ); ApiStatusType RL_Stop_Buzzer( int *ERcode ); ApiStatusType RL_Start_Adc( int AdIdentfier, int *ERcode ); int RL_AdAveraging( int AdLogicalNo, int *AdAverage, int *ERcode ); ApiStatusType RL_GetSwPort( char PortNo, char *Indata, int *ERcode ); void RL_ErrorHook( int FuncNo, int ErrorNo );
For details about the APIs and common functions used by the sample program (musical scale), see the Renesas Starter Kit Library V.1.00 Reference Manual.
REJ05B0817-0110 Rev.1.10
2007.12
Page 6 of 17
M16C/26A Group Sample Program (Musical Scale)
7.
Flowchart
Voltmeter
Clear display on LCD
Show the initial screen
Request AD start
Measure potentiometer
Process buzzer
Process measured value display NO SW1 changed?
YES Process mute display
REJ05B0817-0110 Rev.1.10
2007.12
Page 7 of 17
M16C/26A Group Sample Program (Musical Scale)
8.
1
Tutorial
Launch the HEW by double-clicking its icon.
2
Change the session name from "default Session" to "SessionM16C_E8_System."
REJ05B0817-0110 Rev.1.10
2007.12
Page 8 of 17
M16C/26A Group Sample Program (Musical Scale)
3 Select "M30260F8A" for Device. Select "Download emulator firmware" for Mode.
REJ05B0817-0110 Rev.1.10
2007.12
Page 9 of 17
M16C/26A Group Sample Program (Musical Scale)
Check the box labeled "Power supply is carried out. (MAX 300mA)" and then select "5.0V."
REJ05B0817-0110 Rev.1.10
2007.12
Page 10 of 17
M16C/26A Group Sample Program (Musical Scale)
4 In the program and the work RAM text boxes of Firmware Location Address, enter "FA0" and "0B8" respectively. Leave the box labeled "Debug a program using the WDT" unchecked.
REJ05B0817-0110 Rev.1.10
2007.12
Page 11 of 17
M16C/26A Group Sample Program (Musical Scale)
5 Choose Download from the Debug tab and download a module. The upper-side choices for Download show the location from which a project was downloaded.
REJ05B0817-0110 Rev.1.10
2007.12
Page 12 of 17
M16C/26A Group Sample Program (Musical Scale)
6 Click "Start after Reset" to start program execution.
7
Please do "Cancellation" when "The file is opened" window opens.
REJ05B0817-0110 Rev.1.10
2007.12
Page 13 of 17
M16C/26A Group Sample Program (Musical Scale)
9.
Example Circuit
10. Part List
Part name Buzzer Switching diode Chip resistor PCB header Part No. BUZZ1 D1 R7 JA1,JA2 Q'ty 1 1 1 2 Manufacturer CUI inc ROHM ROHM Molex Type number CEP-1160 1SS355TE-17 MCR10EZHF103 10-88-1261 10k 26pin 1/8W, 5% Male, 2-row, vertical type Value Remark No-polarity, separately exited oscillation
REJ05B0817-0110 Rev.1.10
2007.12
Page 14 of 17
M16C/26A Group Sample Program (Musical Scale)
11.
Web Sitet
Renesas Technology Web site
http://www.renesas.com/
REJ05B0817-0110 Rev.1.10
2007.12
Page 15 of 17
M16C/26A Group Sample Program (Musical Scale) Revision History
Rev. 1.00 1.10 Date of issue 2006.06.30 2007.12.03 Content of revision Page First revision issued Contents of presentation improved Points
REJ05B0817-0110 Rev.1.10
2007.12
Page 16 of 17
M16C/26A Group Sample Program (Musical Scale)
REJ05B0817-0110 Rev.1.10
2007.12
Page 17 of 17


▲Up To Search▲   

 
Price & Availability of BUZZ1

All Rights Reserved © IC-ON-LINE 2003 - 2022  

[Add Bookmark] [Contact Us] [Link exchange] [Privacy policy]
Mirror Sites :  [www.datasheet.hk]   [www.maxim4u.com]  [www.ic-on-line.cn] [www.ic-on-line.com] [www.ic-on-line.net] [www.alldatasheet.com.cn] [www.gdcy.com]  [www.gdcy.net]


 . . . . .
  We use cookies to deliver the best possible web experience and assist with our advertising efforts. By continuing to use this site, you consent to the use of cookies. For more information on cookies, please take a look at our Privacy Policy. X